package cn.tedu.charging.device.warm;

import cn.tedu.charging.device.service.DeviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class StationWarmUp implements ApplicationRunner {
    @Autowired
    private DeviceService deviceService;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        /**
         * bean生命周期 伴随容器启动 步骤
         * 1.实例化对象
         * 2.初始化对象
         */
        log.debug("缓存站场开始预热...");
        deviceService.StartOnceWarmUp();
    }

}
